package com.anjubao.parking.municipal.parkinglot.mapper;

import com.anjubao.parking.municipal.parkinglot.dto.ParkingLotSlotTurnoverDto;
import com.anjubao.parking.municipal.parkinglot.dto.ParkingRecordCostTimeStatDto;
import com.anjubao.parking.municipal.parkinglot.model.ParkingRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 停车记录表mapper
 *
 * @author zhuchunfeng
 */
@Mapper
public interface ParkingRecordMapper extends BaseMapper<ParkingRecord> {

    /**
     * 统计停车时长占比（流量）
     *
     * @param cityId    城市ID
     * @param startTime 开始统计时间
     * @param endTime   结束统计时间
     * @return   停车时长占比
     */
    List<ParkingRecordCostTimeStatDto> queryParkingCostTimeStat(Integer cityId, LocalDateTime startTime, LocalDateTime endTime);

    /**
     * 统计单位时间泊位周转率
     * @param cityId
     * @param startTime
     * @param endTime
     * @return
     */
    ParkingLotSlotTurnoverDto getParkingSlotTurnover(@Param("cityId") Integer cityId,
                                                     @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

}